﻿CREATE PROCEDURE [dbo].[Itinerary_updateitinerarystatus]
	@itinerarySetId bigint,
	@status tinyint = 1
AS

SET NOCOUNT ON
SET XACT_ABORT ON
SET ANSI_PADDING ON

DECLARE @key bigint
SELECT @key = nItinerarySetID
	FROM [dbo].[Itinerary]
	WHERE nItinerarySetID = @itinerarySetId
IF @@ROWCOUNT = 0
	SELECT -1

UPDATE [dbo].[Itinerary]
	SET nStatus = @status
	WHERE nItinerarySetID = @key

SELECT 0
